import axios from "@/utils/request";


// 手动设置token
/* var authority = localStorage.getItem("authority");
var token = null;
if(authority){
    authority = JSON.parse(authority);
    token = authority.token;
}

export const getProListAPI = (params) => axios.get("/pro/list",{
    params:params,
    headers:{
        token:token
    },
}); */


export const getProListAPI = (params) => axios.get("/pro/list",{
    params:params,
});

export const updateFlagAPI = (data) => axios.post("/pro/updateFlag",data,{
    headers:{}
});  
export const updateIsSecondkillAPI = (data) => axios.post("/pro/updateFlag",{type:"isseckill",...data});
export const updateIsrecommendkillAPI = (data) => axios.post("/pro/updateFlag",{type:"isrecommend",...data});


export const getCategoryListAPI = (params) => axios.get("/pro/getCategory",{
    params:params,
});
export const getProSearchListAPI = (data) => axios.post("/pro/searchPro",data);

export const getProDetailAPI = (params) => axios.get("/pro/detail",{
    params:params,
});